package com.evosoft.linker;

import com.evosoft.vista.frame.MainWindow;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * Hello world!
 *
 */
public class App 
{
    private int id;
    private String usuario;
    private MainWindow mainWindow;
    
    public static void main(String[] args) {
        
  	JFrame.setDefaultLookAndFeelDecorated(true);
	//Aplicamos un skin a nuestra ventana, en este caso SaharaSkin

	Runnable doWorkRunnable = new Runnable() {

                        @Override
			public void run() {
                                App.getInstance().run();
			}
		};  
        SwingUtilities.invokeLater(doWorkRunnable);

    }
    
    public void run() {

            mainWindow = new MainWindow();
            mainWindow.setTitle("Linker");
            mainWindow.setVisible(true);
                
            mainWindow.setLocationRelativeTo(null);
    }
    
    public synchronized static App getInstance() {
		while (m_this == null) {
			m_this = new App();
		}
		return m_this;
    }

    public MainWindow getMainWindow() {
        return mainWindow;
    }

    public void setMainWindow(MainWindow mainWindow) {
        this.mainWindow = mainWindow;
    }
    
    public int getId() {
        return id;
    }
    
    public void setTabs(int id) {
        this.id = id;
    }
    
    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }

    private static App m_this;
}
